A number of commonly employed procedures may reduce performance when writing data to a disk. For example, when writing to portable media, performance may be reduced due to aggressive flushing/write through procedures that provide resiliency in the case of surprise removal of the media. While these flushing procedures are quite important, their resulting performance reductions may be a significant component in determining the amount of time required for writing data to a disk. The performance reductions may be further increased when there is a higher ratio of metadata to actual user data, such as when writing larger quantities of smaller files.
The aggressive flushing/write-through procedures often require an overwhelming number of redundant writes due to the flush granularity of a page size. For example, consider an approximately 4 kilobyte page divided into eight sectors of 512 bytes each, which are subdivided into eight entries of 64 bytes each. In this example, assume that the flushing procedures require 5 flushes when creating a directory entry. Also assume that a filesystem writes through changes to a disk instead of caching the changes and gathering the writes. When files are created, metadata for each file takes up an entry with a size of 64 bytes. So as lots of files are being created, as in the case of a copy of a tree, each entry is created and written out. As a result, eight 64 byte entries can be created per sector, flushing each sector 8 times. Since the filesystem writes each sector through five times, that results in 40 unavoidable redundant flushes. However, in addition to these unavoidable redundant flushes, the filesystem is also writing out the remaining 7 sectors in the page. Each of these additional seven sectors is being flushed forty times, which results in 280 avoidable redundant flushes.